<style lang="less" scoped src="./studentinfo.less"></style>
<script src="./studentinfo.js"></script>

<template>
    <div>
        <Row class="query">
            <Col span="24">
            学员姓名 ：<Input v-model="query.name" clearable style="width: 17%"></Input>
            身份证号  ：<Input v-model="query.cardcode" clearable style="width: 17%"></Input>
            家长手机号 ：<Input v-model="query.parentphone" clearable style="width: 17%"></Input>
            家庭号码 ：<Input v-model="query.familyphone" clearable style="width: 17%"></Input>
            </Col>
        </Row>
        <Row class="query">
            <Col span="24">
            <!--点到卡号  ：<Input v-model="query.namingcode" clearable style="width: 17%"></Input>-->
            性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别 ：
            <Select v-model="query.sex" clearable style="width: 17%">
                <Option v-for="item in sexList" :value="item.id" :key="item.id">{{item.name}}</Option>
            </Select>
            <!--年级阶段：-->
            <!--<Select v-model="query.gradeStart" clearable style="width: 17%">-->
                <!--<Option v-for="item in gradeList" :value="item.orders" :key="item.id">{{item.name}}</Option>-->
            <!--</Select>-->
            <!-- - -->
            <!--<Select v-model="query.gradeEnd" clearable style="width: 17%">-->
                <!--<Option v-for="item in gradeList" :value="item.orders" :key="item.id">{{item.name}}</Option>-->
            <!--</Select>-->
            </Col>
        </Row>
        <Row class="query">
            <Col span="20">
            <span @click="loadList"><Button type="primary" icon="android-search">查询</Button></span>
            <span @click="refresh"><Button type="primary" icon="refresh">清空</Button></span>
            </Col>
            <Col span="4">
            <span @click="showAdd"><Button type="primary" icon="android-add">新增</Button></span>
            <span @click="deleteByIds"><Button type="error" icon="android-remove">批量删除</Button></span>
            </Col>
        </Row>
        <div class="main-table">
            <Table border :columns="columns" :data="data" @on-selection-change="selectChange"></Table>
        </div>
        <div class="pagination">
            <Page :total="total" size="small" :page-size="pageSize" :current.sync="pageIndex" @on-change="loadList"
                  show-total show-elevator></Page>
        </div>
        <Modal
                v-model="editModal"
                width="60%"
                :loading="true"
                :draggable="true"
                :closable="isRead" title="新增学生" :mask-closable="isRead"
        >
            <Form :label-width="80" :model="formData" :rules="formDataRules" ref="formData">
                <Row>
                    <Col span="12">
                    <FormItem label="姓名:" prop="name">
                        <Input type="text" v-model="formData.name"></Input>
                    </FormItem>
                    </Col>
                    <Col span="12">
                    <FormItem label="性别:">
                        <Select v-model="formData.sex">
                            <Option v-for="item in sexList" :value="item.id" :key="item.id">{{item.name}}
                            </Option>
                        </Select>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="12">
                    <FormItem label="身份证号:">
                        <Input type="text" v-model="formData.cardcode"></Input>
                    </FormItem>
                    </Col>
                    <Col span="12">
                    <FormItem label="出生日期:" prop="birthdate">
                        <DatePicker type="date" v-model="formData.birthdate" style="width:100%"  confirm></DatePicker>
                    </FormItem>
                    </Col>
                </Row>

                <Row>
                    <Col span="12">
                    <FormItem label="就读年级:">
                        <Select v-model="formData.gradeid">
                            <Option v-for="item in gradeList" :value="item.id" :key="item.id">{{item.name}}
                            </Option>
                        </Select>
                    </FormItem>
                    </Col>
                    <Col span="12">
                    <FormItem label="就读学校:">
                        <Input type="text" v-model="formData.school"></Input>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="12">
                    <FormItem label="家长姓名:">
                        <Input type="text" v-model="formData.parentname"></Input>
                    </FormItem>
                    </Col>
                    <Col span="12">
                    <FormItem label="家长手机号:" prop="parentphone">
                        <Input type="text" v-model="formData.parentphone"></Input>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="12">
                    <FormItem label="家庭电话:">
                        <Input type="text" v-model="formData.familyphone"></Input>
                    </FormItem>
                    </Col>
                    <Col span="12">
                    <FormItem label="学员英文名:">
                        <Input type="text" v-model="formData.ename"></Input>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="12">
                    <FormItem label="学生卡号:">
                        <Input type="text" v-model="formData.stundentcode"></Input>
                    </FormItem>
                    </Col>
                    <Col span="12">
                    <FormItem label="点到卡号:">
                        <Input type="text" v-model="formData.namingcode"></Input>
                    </FormItem>
                    </Col>
                </Row>

                <Row>
                    <Col span="12">
                    <FormItem label="家庭地址:">
                        <Input type="textarea" v-model="formData.familyaddress"></Input>
                    </FormItem>
                    </Col>
                    <Col span="12">
                    <FormItem label="备注:">
                        <Input type="textarea" v-model="formData.remark"></Input>
                    </FormItem>
                    </Col>
                </Row>
                <!--<Row>-->
                    <!--<Col span="24">-->
                        <!--<FormItem label="校区:"  prop="areaId">-->
                            <!--<RadioGroup  v-model="formData.areaId" size="small">-->
                                <!--<Radio v-for="(item,key) in areaList" :key="key" :label="item.id">-->
                                    <!--<span>{{item.name}}</span>-->
                                <!--</Radio>-->
                            <!--</RadioGroup>-->
                        <!--</FormItem>-->
                    <!--</Col>-->
                <!--</Row>-->
            </Form>
            <div slot="footer">
                <Button type="primary" @click="save">保存</Button>
                <Button type="ghost" style="margin-left: 8px" @click="editModal = false">取消</Button>
            </div>
        </Modal>
        <!--<Modal-->
                <!--v-model="editModal"-->
                <!--:title="editTitle"-->
                <!--:mask-closable="isRead"-->
                <!--:closable="isRead"-->
                <!--width="80%">-->
            <!--<div class="modal-div">-->
                <!--<Row class="table-Row">-->
                    <!--<Col span="4" class="titele"><span style="color: red">*</span>姓名：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Input v-model="formData.name" :clearable="!isRead" :readonly="isRead"></Input>-->
                    <!--</Col>-->
                    <!--<Col span="4" class="titele">性别：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Select v-model="formData.sex" :clearable="!isRead" :disabled="isRead">-->
                        <!--<Option v-for="item in sexList" :value="item.id" :key="item.id">{{item.name}}</Option>-->
                    <!--</Select>-->
                    <!--</Col>-->
                <!--</Row>-->
                <!--<Row class="table-Row">-->
                    <!--<Col span="4" class="titele">身份证号：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Input v-model="formData.cardcode" :clearable="!isRead" :readonly="isRead" ></Input>-->
                    <!--</Col>-->
                    <!--<Col span="4" class="titele"><span style="color: red">*</span>出生日期：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<DatePicker v-model="formData.birthdate" :editable="false" :clearable="!isRead" :readonly="isRead" style="width: 100%"></DatePicker>-->
                    <!--</Col>-->
                <!--</Row>-->
                <!--<Row class="table-Row">-->
                    <!--<Col span="4" class="titele">就读年级：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Select v-model="formData.gradeid" :clearable="!isRead" :disabled="isRead">-->
                        <!--<Option v-for="item in gradeList" :value="item.id" :key="item.id">{{item.name}}</Option>-->
                    <!--</Select>-->
                    <!--</Col>-->
                    <!--<Col span="4" class="titele">就读学校：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Input v-model="formData.school" :clearable="!isRead" :readonly="isRead"></Input>-->
                    <!--</Col>-->
                <!--</Row>-->
                <!--<Row class="table-Row">-->
                    <!--<Col span="4" class="titele">家长姓名：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Input v-model="formData.parentname" :clearable="!isRead" :readonly="isRead"></Input>-->
                    <!--</Col>-->
                    <!--<Col span="4" class="titele"><span style="color: red">*</span>家长手机号：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Input v-model="formData.parentphone" :clearable="!isRead" :readonly="isRead" ></Input>-->
                    <!--</Col>-->
                <!--</Row>-->
                <!--<Row class="table-Row">-->
                    <!--<Col span="4" class="titele">家庭电话：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Input v-model="formData.familyphone" :clearable="!isRead" :readonly="isRead" ></Input>-->
                    <!--</Col>-->
                    <!--<Col span="4" class="titele">学员英文名：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Input v-model="formData.ename" :clearable="!isRead" :readonly="isRead" ></Input>-->
                    <!--</Col>-->
                <!--</Row>-->
                <!--<Row class="table-Row">-->
                    <!--<Col span="4" class="titele">点到卡号：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Input v-model="formData.namingcode" :clearable="!isRead" :readonly="isRead" ></Input>-->
                    <!--</Col>-->
                    <!--<Col span="4" class="titele">学生卡号：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Input v-model="formData.stundentcode" :clearable="!isRead" :readonly="isRead" ></Input>-->
                    <!--</Col>-->
                <!--</Row>-->
                <!--<Row class="table-Row">-->
                    <!--<Col span="4" class="titele">家庭地址：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Input type="textarea" :rows="2" v-model="formData.familyaddress" :clearable="!isRead" :readonly="isRead"></Input>-->
                    <!--</Col>-->
                    <!--<Col span="4" class="titele">备注：</Col>-->
                    <!--<Col span="8" class="content">-->
                    <!--<Input type="textarea" :rows="2" v-model="formData.remark" :clearable="!isRead" :readonly="isRead"></Input>-->
                    <!--</Col>-->
                <!--</Row>-->
            <!--</div>-->
            <!--<div slot="footer">-->
                <!--<Button type="primary" @click="save">保存</Button>-->
                <!--<Button type="ghost" style="margin-left: 8px" @click="editModal = false">取消</Button>-->
            <!--</div>-->
        <!--</Modal>-->

        <Modal
                v-model="viewModal"
                :title="editTitle"
                :mask-closable="true"
                :closable="true"
                width="80%">
            <stundent-detail :studentid="formData.id"></stundent-detail>
        </Modal>

        <Modal
                title="课表详情"
                v-model="classScheduleVisible"
                width="100%"
                :footer-hide="true"
                :mask-closable="false">
            <classesSchedule ref="classesSchedule" :studentId="entity.id"></classesSchedule>
        </Modal>
    </div>
</template>